package com.google.code.newpath.config;

import java.util.Map;

import com.google.code.newpath.core.Path;
import com.google.code.newpath.core.ResourceConfig;
import com.google.code.newpath.util.ValueUtils;

public class BeanResourceConfig implements ResourceConfig {
	
	private Path path;
	
	private String className;
	
	private String scope;
	
	private String initMethod;
	
	private String destroyMethod;
	
	private Map<String, Object> properties;

	public Path getPath() {
		return path;
	}

	public void setPath(Path path) {
		this.path = path;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	public String getInitMethod() {
		return initMethod;
	}

	public void setInitMethod(String initMethod) {
		this.initMethod = initMethod;
	}

	public String getDestroyMethod() {
		return destroyMethod;
	}

	public void setDestroyMethod(String destroyMethod) {
		this.destroyMethod = destroyMethod;
	}

	public Map<String, Object> getProperties() {
		return properties;
	}

	public void setProperties(Map<String, Object> properties) {
		this.properties = properties;
	}

	public boolean isCreatable() {
		//If exists the none empty className, it indicate this resource is creatable one.
		return ValueUtils.notEmpty(className);
	}
	
	

}
